package com.highper.account.controller;

import com.highper.account.service.IAtosAccountService;
import com.highper.common.entity.po.account.AtosAccount;
import com.highper.common.entity.response.HighperResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author ZhangGJ
 * @Date 2022/02/07 09:33
 */
@RestController
@RequestMapping("atos/account")
public class AtosAccountController {

    private final IAtosAccountService atosAccountService;

    @Autowired
    public AtosAccountController(IAtosAccountService atosAccountService) {
        this.atosAccountService = atosAccountService;
    }

    @GetMapping("list")
    public HighperResponse atosAccountList() {
        return HighperResponse.data(atosAccountService.list());
    }

    @PostMapping("insert")
    public HighperResponse insertAtosAccount(@RequestBody AtosAccount atosAccount) {
        return HighperResponse.result(atosAccountService.save(atosAccount));
    }
}
